package org.feiye.studyday20;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class HashSetTest {

	public static void main(String[] args) {
		Set set = new HashSet();
		set.add(new Person("小张", "女", 9));
		set.add(new Person("小李", "男", 19));
		set.add(new Person("小王", "女", 29));
		set.add(new Person("小张", "女", 9));
		set.add(new Person("小蒋", "男", 93));
		set.add(null);
		System.out.println(set.size());

		Iterator iterator = set.iterator();
		while (iterator.hasNext()) {
			Person p = (Person) iterator.next();
			System.out.println(p.getName() + "-" + p.getAge() + "-" + p.getSex());
		}

	}

}
